import format from '@dfeidao/atom-web/dt/format';
import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import p001 from './p001';
import p003 from './p003';

export default async function a010(fd: IFeidaoAiBrowserComponent) {
	// todo
	const ret = await nodejs<{dt1: Array<{exam_name: string;start_time: number;
		examination_category: string;exam_time: string;exam_score: string;
		finish_time: number}>,t: number}>('examination-management/zj-000001/s001',
		{filter:{page_no:1}});
	const ren = ret.dt1.map((n) => {
		return {...n,start_time:format(n.start_time,2),finish_time:format(n.finish_time,2)};
	});

	render(fd,ren,p001,'p001','inner');

	if (ret.t > 20) {
		render(fd,ret.t,p003,'p003','inner');
	}
}
